<template>
  <div>
    <el-row>
      <el-col :span="12"
        ><div class="grid-content">
          <v-chart :options="option1" :watchShallow="true" :auto-resize="true" :style="{ width: '100%', height: '100%' }" /></div
      ></el-col>
      <el-col :span="12"
        ><div class="grid-content"><v-chart :options="option2" :watchShallow="true" :auto-resize="true" :style="{ width: '100%', height: '100%' }" /></div
      ></el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <div class="table-sty">
          <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="month" label="月份"> </el-table-column>
            <el-table-column prop="zm" label="照明插座用电支出"> </el-table-column>
            <el-table-column prop="kt" label="空调用电支出"> </el-table-column>
            <el-table-column prop="dl" label="动力用电支出"> </el-table-column>
            <el-table-column prop="cf" label="厨房用电支出"> </el-table-column>
            <el-table-column prop="xx" label="信息中心用电支出"> </el-table-column>
            <el-table-column prop="qt" label="其他特殊用电支出"> </el-table-column>
            <el-table-column prop="by" label="备用用电支出"> </el-table-column>
          </el-table>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  name: 'stafftransfer',
  data() {
    return {
      option1: {
        title: {
          text: '电费支出',
          left: 'center'
        },
        xAxis: {
          type: 'category',
          data: ['12月', '11月', '10月', '9月', '8月', '7月']
        },
        yAxis: {
          type: 'value'
        },
        legend: {
          data: ['照明插座用电支出', '空调用电支出', '动力用电支出', '厨房用电支出', '信息中心用电支出', '其他特殊用电支出', '备用用电支出'],
          bottom: 0
        },
        series: [
          {
            name: '照明插座用电支出',
            data: [103553, 102387, 92003, 119023, 119023, 103482],
            type: 'bar'
          },
          {
            name: '空调用电支出',
            data: [38672, 40032, 23013, 39134, 37823, 37430],
            type: 'bar'
          },
          {
            name: '动力用电支出',
            data: [20520, 23984, 10823, 19034, 24091, 21304],
            type: 'bar'
          },
          {
            name: '厨房用电支出',
            data: [15347, 14678, 12394, 17923, 14092, 16327],
            type: 'bar'
          },
          {
            name: '信息中心用电支出',
            data: [12390, 11093, 9023, 13021, 12341, 13240],
            type: 'bar'
          },
          {
            name: '其他特殊用电支出',
            data: [2616, 2490, 2001, 2409, 1555, 3100],
            type: 'bar'
          },
          {
            name: '备用用电支出',
            data: [1619, 1590, 1803, 13674, 1923, 1682],
            type: 'bar'
          }
        ]
      },
      option2: {
        title: {
          text: '12月份',
          left: 'center'
        },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          top: '5%',
          left: 'center'
        },
        series: [
          {
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 20,
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: [
              { value: 103553, name: '照明插座用电支出' },
              { value: 38672, name: '空调用电支出' },
              { value: 20520, name: '动力用电支出' },
              { value: 15347, name: '厨房用电支出' },
              { value: 12390, name: '信息中心用电支出' },
              { value: 2616, name: '其他特殊用电支出' },
              { value: 1619, name: '备用用电支出' },
            ]
          }
        ]
      },
      tableData: [
        {
          month: '12月',
          zm: 103553,
          kt: 38672,
          dl: 20520,
          cf: 15343,
          xx: 12390,
          qt: 2616,
          by: 1619
        },
        {
          month: '11月',
          zm: 102387,
          kt: 40032,
          dl: 23984,
          cf: 14678,
          xx: 11093,
          qt: 2490,
          by: 1590
        },
        {
          month: '10月',
          zm: 92003,
          kt: 23013,
          dl: 18023,
          cf: 12394,
          xx: 9023,
          qt: 2001,
          by: 1803
        },
        {
          month: '9月',
          zm: 119023,
          kt: 39134,
          dl: 19034,
          cf: 17923,
          xx: 13021,
          qt: 2409,
          by: 13674
        },
        {
          month: '8月',
          zm: 110923,
          kt: 37823,
          dl: 24091,
          cf: 14092,
          xx: 12341,
          qt: 1555,
          by: 1923
        },
        {
          month: '7月',
          zm: 103482,
          kt: 37430,
          dl: 21034,
          cf: 16327,
          xx: 13240,
          qt: 3100,
          by: 1682
        },
      ]
    };
  }
};
</script>
<style lang="scss" scoped>
.grid-content {
  height: 50vh;
  margin-top: 20px;
}
.table-sty {
  margin: 20px;
}
</style>
